/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.cip.esymons.tramite.bc;

import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import org.cip.esymons.colegiatura.be.Colegiado;
import org.cip.esymons.tramite.be.RecepAutoCert;

/**
 *
 * @author Cristian
 */
public class RecepAutoCertDelegate {

    private RecepAutoCertFacadeLocal local;

    public RecepAutoCertDelegate() {
        local=lookupRecepAutoCertFacade();
    }

    public void create(RecepAutoCert re){
        local.create(re);
    }

    public void edit(RecepAutoCert re){
        local.edit(re);
    }

    public List<RecepAutoCert> listarXColegiado(Colegiado col){
        return local.listarXColegiado(col);
    }

    private RecepAutoCertFacadeLocal lookupRecepAutoCertFacade() {
        try {
            Context c = new InitialContext();
            return (RecepAutoCertFacadeLocal) c.lookup("java:comp/env/RecepAutoCertFacade");
        } catch (NamingException ne) {
            Logger.getLogger(getClass().getName()).log(Level.SEVERE, "exception caught", ne);
            throw new RuntimeException(ne);
        }
    }



}
